package indoor.nexd.com.nexdmap.presenter;

import android.content.Context;
import android.content.SharedPreferences;

import indoor.nexd.com.nexdmap.ui.inte.ILoadingActivity;
import indoor.nexd.com.nexdmap.util.SharedPreferencesUtil;

/**
 * Created by wangxu on 16/5/4.
 */
public class LoadingPresenter extends BasePresenter<ILoadingActivity> {

    SharedPreferences spIsFirstInstall;

    public LoadingPresenter(Context context, ILoadingActivity iView) {
        super(context, iView);
    }

    @Override
    public void init() {
        super.init();
        spIsFirstInstall = SharedPreferencesUtil.isFirstInstall(context);
        boolean isFirst = spIsFirstInstall.getBoolean("isFirst", false);
        if (!isFirst) {
            SharedPreferences.Editor editor = spIsFirstInstall.edit();
            editor.putBoolean("isFirst", true);
            editor.commit();
            iView.initAnimation();
        } else {
            iView.intoOtherActivity();
        }
    }
}
